class CreateEshopComments < ActiveRecord::Migration
  def change
    create_table :eshop_comments, :force => true do |t|
        t.column :title, :string, :limit => 50, :default => ""
        t.column :comment, :text, :null => false
        t.column :created_at, :datetime, :null => false
        t.column :commentable_id, :integer, :default => 0, :null => false
        t.column :commentable_type, :string, :limit => 15, :default => "", :null => false
        t.references :user, :integer, :null => true
    end

    add_index :eshop_comments, :user_id
  end
end
